import request from '@/utils/request'
import store from '@/store'

export function GetProvinceList () {
  return request({
    url: '/province/selector',
    method: 'get'
  })
}

export function GetCityList () {
  return request({
    url: '/city/selector',
    params: {
      'province-id': store.getters.provinceId
    },
    method: 'get'
  })
}

export function GetAreaList () {
  return request({
    url: '/area/selector',
    params: {
      'city-id': store.getters.cityId
    },
    method: 'get'
  })
}

export function GetSchoolList () {
  return request({
    url: '/school/selector',
    method: 'get'
  })
}

export function GetCityListByProvinceId (provinceId) {
  return request({
    url: '/city/selector',
    params: {
      'province-id': provinceId
    },
    method: 'get'
  })
}

export function GetAreaListByCityId (cityId) {
  return request({
    url: '/area/selector',
    params: {
      'city-id': cityId
    },
    method: 'get'
  })
}

export function GetSchoolListByAreaId (areaId) {
  return request({
    url: 'school/selector',
    params: {
      'area-id': areaId
    },
    method: 'get'
  })
}

export function GetSchoolTypeBySchoolId (schoolId) {
  return request({
    url: 'school/schooltype',
    params: {
      'school-id': schoolId
    },
    method: 'get'
  })
}
